package com.mt.components.general {
	import flash.events.MouseEvent;
	
	import mx.controls.DateField;
	
	/**      
	 * 类名称：MDatefield<br>
	 * 类描述：可以带清空的时间控件<br>
	 * 创建人：马腾<br>
	 * 创建时间：Dec 7, 2012 9:32:41 PM<br>
	 * 修改人：马腾<br>
	 * 修改时间：Dec 7, 2012 9:32:41 PM<br>
	 */
	public class MDatefield extends DateField {
		
		override protected function commitProperties():void {
			super.commitProperties();
			doubleClickEnabled = true;
			addEventListener(MouseEvent.DOUBLE_CLICK , doubleClickToClear);
		}
		
		protected function doubleClickToClear(event:MouseEvent):void {
			this.text = null;
			this.selectedDate = null;
		}
	}
}